package com.gaoyi.crm.db.dto;

import android.os.Parcel;
import android.os.Parcelable;

public class ShortDto extends BaseDto implements Parcelable {
    private String name;
    private String code;
    private Boolean def;
    private Boolean isSelect = false;

    public ShortDto() {
    }

    protected ShortDto(Parcel in) {
        name = in.readString();
        code = in.readString();
        byte tmpDef = in.readByte();
        def = tmpDef == 0 ? null : tmpDef == 1;
        byte tmpIsSelect = in.readByte();
        isSelect = tmpIsSelect == 0 ? null : tmpIsSelect == 1;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(code);
        dest.writeByte((byte) (def == null ? 0 : def ? 1 : 2));
        dest.writeByte((byte) (isSelect == null ? 0 : isSelect ? 1 : 2));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ShortDto> CREATOR = new Creator<ShortDto>() {
        @Override
        public ShortDto createFromParcel(Parcel in) {
            return new ShortDto(in);
        }

        @Override
        public ShortDto[] newArray(int size) {
            return new ShortDto[size];
        }
    };

    public Boolean getSelect() {
        return isSelect;
    }

    public void setSelect(Boolean select) {
        isSelect = select;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Boolean getDef() {
        return def;
    }

    public void setDef(Boolean def) {
        this.def = def;
    }
}
